package top.lyc829.zzl_android.ui.index;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

import top.lyc829.zzl_android.MyApp;
import top.lyc829.zzl_android.R;
import top.lyc829.zzl_android.logic.bean.BaseBean;

public class RecyclerViewAdapter extends BaseQuickAdapter<BaseBean, BaseViewHolder> implements LoadMoreModule {

    public RecyclerViewAdapter() {
        super(R.layout.index_item);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, BaseBean baseBean) {
        baseViewHolder.setText(R.id.base_index_title, baseBean.getTitle());
        Glide.with(MyApp.getContext())
                .load(baseBean.getIndexImgUrl())
                .into((ImageView) baseViewHolder.getView(R.id.base_index_image));
    }
}
